var mongoose = require("mongoose");
var Schema = mongoose.Schema;

var usersSchema = new Schema(
  {
    phone: { type: String, default: "" },
    userid: { type: String, default: Math.random() * 1000000000 },
    name: { type: String, default: "新用户" },
    password: { type: String, default: "" },
    location: { type: String, default: "" },
    gender: { type: Number, default: "0" },
    email: { type: String, default: "111@qq.com" },
    photo: {
      type: String,
      default: "http://127.0.0.1:3000/uploads/image/default_icon.png",
    },
    birthday: { type: String, default: "2016-1-11" },
    fans: { type: Array, default: [] },
    follow: { type: Array, default: [] },
    myvideos: { type: Array, default: [] },
    likevideos: { type: Array, default: [] },
    introduce: { type: String, default: "" },
    likeComments: { type: Array, default: [] },
    likeVideoStyle: { type: Array, default: [] },
    messages: { type: Array, default: [] },
    baseUrl: { type: String, default: "http://127.0.0.1:3000" },
    newFocuVideos: { type: Number, default: 0 },
    isEffective: { type: Boolean, default: true },
  },
  { versionKey: false }
);

var usersModel = mongoose.model("users", usersSchema);

module.exports = usersModel;
